using System;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Rhino.Commons;

namespace WineCellar.Core.Interfaces
{
    public interface IEntityService<T>
    {
        T Get(Guid id);

        ICollection<T> GetAll();
        
        FutureQueryOf<T> GetAll(int start, int limit,string orderBy, string sortOrder);

        FutureQueryOf<T> GetAll(int firstResult, int numberOfResults,string orderBy, string sortOrder, IEnumerable<string> eagerLoadingFor);

        FutureQueryOf<T> Search(ISearchObject searchObject, int start, int limit, string sort, string dir, IEnumerable<string> eagerLoadingFor);

        FutureQueryOf<T> Search(ISearchObject searchObject, int start, int limit, string sort, string dir);

        void Remove(T instance);

        void Save(T instance);

        bool IsUpdate(Guid id);

        ICollection<T> LuceneSearch(string searchString, IEnumerable<JToken> tokens);

        ICollection<T> LuceneSearch(string searchString, IEnumerable<JToken> tokens,string restrictionSearchString, string restrictionToken);
    }
}